Skip to content

fix: Allow array map on empty arrays#6305

Merged
jfecher merged 3 commits intomasterfrom
jf/map-empty
Oct 21, 2024
Merged

fix: Allow array map on empty arrays#6305
jfecher merged 3 commits intomasterfrom
jf/map-empty

Conversation

@jfecher
Copy link
Copy Markdown
Contributor

@jfecher jfecher commented Oct 21, 2024

Description

Problem*

Resolves a private issue sent to me on slack

Summary*

Array map is a fairly old method written before we had std::mem::zeroed. Now that we have zeroed, we can allow mapping empty arrays since we can use zeroed to get the filler U value for the starting elements.

Additional Context

While I was at it I included a small clarification to reduce's docs that it requires a non-empty array

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants